From 20fafa287adec1382257622fc23bd6f58b09f3a2 Mon Sep 17 00:00:00 2001
From: Fuwn <contact@fuwn.me>
Date: Fri, 19 Jan 2024 00:26:17 -0800
Subject: feat: root prefix all links

---
 src/routes/tools/[tool]/+page.svelte | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

(limited to 'src/routes/tools/[tool]/+page.svelte')

diff --git a/src/routes/tools/[tool]/+page.svelte b/src/routes/tools/[tool]/+page.svelte
index adcd6442..945acbd4 100644
--- a/src/routes/tools/[tool]/+page.svelte
+++ b/src/routes/tools/[tool]/+page.svelte
@@ -13,13 +13,14 @@
 	import { goto } from '$app/navigation';
 	import Picker from '$lib/Tools/Picker.svelte';
 	import Likes from '$lib/Tools/Likes.svelte';
+	import root from '$lib/Utility/root.js';
 
 	export let data;
 
 	let tool = data.tool ?? 'default';
 
 	onMount(() => {
-		if (tool === 'default') goto('/tools');
+		if (tool === 'default') goto(root('/tools'));
 	});
 
 	$: suggestion = closest(tool, Object.keys(tools));
@@ -35,7 +36,7 @@
 
 		<blockquote style="margin: 0 0 0 1.5rem;">
 			Did you mean "<a
-				href={`/tools/${tools[suggestion].id}`}
+				href={root(`/tools/${tools[suggestion].id}`)}
 				on:click={() => (tool = suggestion)}
 				style={suggestion === '...' ? 'pointer-events: none; color: inherit;' : ''}
 			>
-- 
cgit v1.2.3

